package main

import (
	"log"
	"zxstudy.com/infrastructure/persistence"
	"zxstudy.com/infrastructure/endpoint"
)

func main() {
	service, err := persistence.Open("localhost", "demo2", "root", "root", "utf8", 3306)
	if err != nil {
		log.Fatal(err)
	}
	defer service.Close()
	err = service.Automigrate()
	if err != nil {
		log.Fatal(err)
	}

	log.Fatal(endpoint.Run(service))
}